class Bullet : Actor
{
protected ParticleEngine particleEngine;
+ public int Power;
- public Bullet(Game newGame)
+ public Bullet(SuperPolarity newGame)
: base(newGame)
{
}
public override void Initialize(Texture2D texture, Vector2 position)
{
base.Initialize(texture, position);
+ BoxDimensions.X = 10;
+ BoxDimensions.Y = 10;
+ BoxDimensions.W = 10;
+ BoxDimensions.Z = 10;
+ InitBox();
particleEngine = ParticleEffectFactory.CreateBullet(position);
}
Velocity.X = (float)(MaxVelocity * Math.Cos(Angle));
Velocity.Y = (float)(MaxVelocity * Math.Sin(Angle));
+ Power = 1;
+
Position += Velocity;
+ UpdateBox();
particleEngine.Update();
particleEngine.EmitterLocation = Position;
base.Draw(spriteBatch);
particleEngine.Draw(spriteBatch);
}
+
+ public override void Collide(Actor other, Rectangle collision)
+ {
+ if (Dying) { return; }
+ if (other.GetType().IsAssignableFrom(typeof(StandardShip)))
+ {
+ Die();
+ return;
+ }
+ }
+
+ protected override void Die()
+ {
+ ActorManager.CheckOut(this);
+ Parent.Children.Remove(this);
+ }
}
}